bin = code.exe
cp = g++ -std=c++11
src = $(wildcard *.cpp)
obj = $(src:.cpp=.o)
command1 = -c
command2 = -o
RM = rm -rf
$(bin):$(obj)
	@$(cp) $^ $(command2) $@
%.o:%.cpp 
	@$(cp) $(command1) $< 


.PHONY:clean
clean:
	@$(RM) $(bin) $(obj)


#code:code.o
#	@g++ code.o -o code
#code.o:code.cpp
#	@g++ -c code.cpp -o code.o -std=c++11


